using System.Data;
using System.Data.Common;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

namespace Microsoft.EntityFrameworkCore.Dm.Storage.Internal;

public class DmDateTimeTypeMapping : DateTimeTypeMapping
{
	private const string DateFormatConst = "{0:yyyy-MM-dd}";

	private const string DateTimeFormatConst = "{0:yyyy-MM-dd HH:mm:ss.ffffff}";

	protected override string SqlLiteralFormatString
	{
		get
		{
			if (!(((RelationalTypeMapping)this).StoreType == "date"))
			{
				return "'{0:yyyy-MM-dd HH:mm:ss.ffffff}'";
			}
			return "'{0:yyyy-MM-dd}'";
		}
	}

	public DmDateTimeTypeMapping([NotNull] string storeType, DbType? dbType = null)
		: base(storeType, dbType)
	{
	}

	protected DmDateTimeTypeMapping(RelationalTypeMappingParameters parameters)
		: base(parameters)
	{
	}//IL_0001: Unknown result type (might be due to invalid IL or missing references)


	protected override void ConfigureParameter(DbParameter parameter)
	{
		base.ConfigureParameter(parameter);
	}

	// Token: 0x060001AC RID: 428 RVA: 0x00009020 File Offset: 0x00007220
	public override RelationalTypeMapping Clone(string storeType, int? size)
	{
		return new DmDateTimeTypeMapping(this.Parameters.WithStoreTypeAndSize(storeType, size, null));
	}

	// Token: 0x060001AD RID: 429 RVA: 0x0000904C File Offset: 0x0000724C
	public override CoreTypeMapping Clone(ValueConverter converter)
	{
		return new DmDateTimeTypeMapping(this.Parameters.WithComposedConverter(converter));
	}
}
